{include file="public/meta" /}
<title>评论列表</title>
</head>
<body>
        <article class="cl pd-20">
            <div class="mt-20">
                <table class="table table-border table-bordered table-hover table-bg table-sort">
                    <thead>
                    <tr class="text-c">
                        <th width="40">ID</th>
                        <th width="100">用户昵称</th>
                        <th width="50">评价星数</th>
                        <th>内容</th>
                        <th>图片</th>
                        <th width="100">操作</th>
                    </tr>
                    </thead>
                    {volist name="list" id="val"}
                    <tbody>
                    <tr class="text-c">
                        <td>{$val['id']}</td>
                        <td>{$val['user_nickname']} -- {$val['true_name']}</td>
                        <td>{$val['xing']}</td>
                        <td>
                            {foreach name="val['images']" item="vo"}
                            <img width="60" class="product-thumb" src="{$vo}">
                            {/foreach}
                        </td>
                        <td>{$val['content']}</td>
                        <td class="td-manage">
                            <a title="删除" href="javascript:;" onclick="article_del(this,'{$val['id']}')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a></td>
                    </tr>
                    </tbody>
                    {/volist}
                </table>
                <div class="bjwl_paginate">
                    {$list->render()}
                </div>
            </div>
        </article>
<!--_footer 作为公共模版分离出去-->
{include file="public/footer" /}
<!--/_footer /作为公共模版分离出去-->
<script type="text/javascript">

    /*删除*/
    function article_del(obj,id){
        layer.confirm('确认要删除吗？',function(index){
            $.ajax({
                url:"{:url('Goods/commentdel')}",
                type:'post',
                data:{'id':id},
                dataType:'json',
                success:function(data){
                    if(data.code==0)
                    {
                        $(obj).parents("tr").remove();
                        layer.msg(data.msg,{icon:6,time:1000});
                    }
                    else{
                        layer.msg(data.msg,{icon:5,time:1000});
                    }
                },
                error:function(data){
                    layer.msg(data.msg,{icon:5,time:1000});
                }
            });
        });
    }
</script>
</body>
</html>